home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PASCALL
/
RANDPIX
/
RANDPIXL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-01-22
|
1KB
|
65 lines
program randpixl;
uses
crt,graph;
procedure setupgraph(Gd,Gm:integer);
begin
InitGraph(Gd,Gm,'c:\tp\bgi');
if GraphResult<>grOk then halt;
cleardevice;
end;
function cycle:boolean;
var
a:byte;
procedure go;
var
x,y:integer;
color,radius:word;
begin
delay(80);
randomize;
randseed:=random(getmaxx div 2);
x:=random(getmaxx);
randseed:=random(getmaxy div 2);
y:=random(getmaxy);
randseed:=random(getmaxcolor);
color:=random(getmaxcolor)+(getmaxcolor div 2);
randseed:=random(getmaxy div 2);
radius:=random(getmaxy div 2);
setcolor(color);
circle(x,y,radius);
end;
function test:byte;
function inkey:char;
var
d:char;
begin
if keypressed then inkey:=readkey else inkey:=chr(8);
end;
begin
case upcase(inkey) of
'S',#27: test:=1;
'A': test:=2;
else test:=0;
end;
end;
begin
repeat
go;
a:=test;
until a>0;
cycle:=(a=1);
end;
begin
setupgraph(vga,vgahi);
repeat
cleardevice;
until cycle;
end.